﻿<%@ Page Language="C#" AutoEventWireup="true" %>
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.SqlClient" %>
<script runat="server">
protected decimal[] Data=new decimal[450];
protected string Notice = "";
protected string ChanPin = "套管";
protected string GangJi = "J55";
protected string GuiGe = "Φ139.7×7.72";
protected string[] BanZhu = {"", "", "", "", "", ""};
protected int LeiJiBanCi = 0;
protected int DangRiBanCi = 0;
protected void Page_Load(object sender, EventArgs e)
{
    if (!this.IsPostBack)
    {
        Date1.Text = DateTime.Today.AddDays(-1).ToString("yyyy年M月d日");

        if ((object)Session["OperatorDID"] != null)
        {
            int did = (int)Session["OperatorDID"];
            if (did != 0)
            {
                if (did == 1)
                {

                }
                else if (did == 2)
                {
                    this.FenChang.Text = "2";
                    this.FenChang.Enabled = false;
                }
                else if (did == 5)
                {
                    this.FenChang.Text = "5";
                    this.FenChang.Enabled = false;
                }

            }
        }
    }
    if (this.FenChang.Text == "5")
    {
        this.ChanPin = "油管";
        this.GuiGe = "Φ73.02×5.51";
    }
    QueryData();
}
private void QueryData()
{
    DateTime d1, d2, d3;
    int fc = int.Parse(this.FenChang.Text);

    if (!DateTime.TryParse(this.Date1.Text, out d1))
    {
        this.Notice = "日期录入有误";
        return;
    }

    System.Data.SqlClient.SqlConnection Conn = new System.Data.SqlClient.SqlConnection();
    Conn.ConnectionString = ConfigurationManager.ConnectionStrings["SCMConnectionString1"].ConnectionString;
    Conn.Open();
    System.Data.SqlClient.SqlCommand Cmd = new System.Data.SqlClient.SqlCommand();
    Cmd.Connection = Conn;

    Cmd.CommandText = @"declare @y int
declare @d1 smalldatetime
if exists(select * from 生产月设置 where 分厂=@fc and @d0>=起始日期 and @d0<=截止日期)
begin
    select @y=年度,@d1=起始日期 from 生产月设置 where 分厂=@fc and @d0>=起始日期 and @d0<=截止日期
    if exists(select * from 生产月设置 where 分厂=@fc and 年度=@y and 月份=1)
    begin
	    select @d1 as 月累计日期,起始日期 as 年累计日期 from 生产月设置 where 分厂=@fc and 年度=@y and 月份=1
    end
end";
    Cmd.CommandText = Cmd.CommandText.Replace("@d0", "'" + d1.ToShortDateString() + "'");
    Cmd.CommandText = Cmd.CommandText.Replace("@fc", fc.ToString());
    System.Data.SqlClient.SqlDataReader Reader = Cmd.ExecuteReader();
    if (Reader.Read())
    {
        d2 = (DateTime)Reader["月累计日期"];
        d3 = (DateTime)Reader["年累计日期"];
        this.Date2.Text = d2.ToLongDateString();
        this.Date3.Text = d3.ToLongDateString();
    }
    else
    {
        this.Date2.Text = d1.Year.ToString() + "年" + d1.Month.ToString() + "月1日";
        this.Date3.Text = d1.Year.ToString() + "年1月1日";
        d2 = DateTime.Parse(this.Date2.Text);
        d3 = DateTime.Parse(this.Date3.Text);
    }
    Reader.Close();

    Cmd.CommandText =
@"SELECT top 6
生产线,工段
,sum(计划支数) as 计划支数
,sum(计划重量) as 计划重量
,sum(投入支数) as 投入支数
,sum(投入重量) as 投入重量
,sum(机紧1) as 机紧1
,sum(机紧2) as 机紧2
,sum(静水压) as 静水压
,sum(称测支数) as 称测支数
,sum(称测长度) as 称测长度
,sum(称测重量) as 称测重量
,sum(包装支数) as 包装支数
,sum(包装捆数) as 包装捆数
,sum(包装长度) as 包装长度
,sum(包装重量) as 包装重量
,sum(入库支数) as 入库支数
,sum(入库捆数) as 入库捆数
,sum(入库长度) as 入库长度
,sum(入库重量) as 入库重量
,sum(未入库支数) as 未入库支数
,sum(未入库重量) as 未入库重量
,sum(车丝1) as 车丝1
,sum(车丝2) as 车丝2
,sum(车丝3) as 车丝3
,sum(车丝4) as 车丝4
,sum(车丝5) as 车丝5
,sum(车丝6) as 车丝6
FROM 生产进度 where 分厂ID=" + fc + " and 日期='" + d1.ToShortDateString() + "' group by 生产线,工段 order by 工段,生产线";
    Reader = Cmd.ExecuteReader();
    string[] bz={"甲","乙","丙","丁"};
    int row = 0;
    int i;
    string blist = ",";
    
    while (Reader.Read())
    {
        BanZhu[row] = bz[((int)Reader[1]) - 1] + "班组" + ((int)Reader[0]) + "号线";
        for (i = 0; i < 26; i++)
        {
            Data[row*30+i] = Convert.ToDecimal(Reader[i+2]);
        }
        if (blist.IndexOf("," + ((int)Reader[1]) + ",") < 0)
        {
            blist += ((int)Reader[1])+",";
        }
        row++;
    }
    Reader.Close();

    if (blist != ",")
    {
        blist = blist.Substring(1);
        blist = blist.Substring(0,blist.Length-1);
        Cmd.CommandText =
        @"SELECT top 6
生产线,工段
,sum(计划支数) as 计划支数
,sum(计划重量) as 计划重量
,sum(投入支数) as 投入支数
,sum(投入重量) as 投入重量
,sum(机紧1) as 机紧1
,sum(机紧2) as 机紧2
,sum(静水压) as 静水压
,sum(称测支数) as 称测支数
,sum(称测长度) as 称测长度
,sum(称测重量) as 称测重量
,sum(包装支数) as 包装支数
,sum(包装捆数) as 包装捆数
,sum(包装长度) as 包装长度
,sum(包装重量) as 包装重量
,sum(入库支数) as 入库支数
,sum(入库捆数) as 入库捆数
,sum(入库长度) as 入库长度
,sum(入库重量) as 入库重量
,sum(未入库支数) as 未入库支数
,sum(未入库重量) as 未入库重量
,sum(车丝1) as 车丝1
,sum(车丝2) as 车丝2
,sum(车丝3) as 车丝3
,sum(车丝4) as 车丝4
,sum(车丝5) as 车丝5
,sum(车丝6) as 车丝6
FROM 生产进度 where 分厂ID=" + fc + " and 工段 in(" + blist + ") and 日期 between '"
                       + d2.ToShortDateString() + "' and '" + d1.ToShortDateString()
                       + "' group by 生产线,工段 order by 工段,生产线";
        Reader = Cmd.ExecuteReader();
        row = 0;
        while (Reader.Read())
        {
            for (i = 0; i < 26; i++)
            {
                Data[row * 30 + 180 + i] = Convert.ToDecimal(Reader[i + 2]);
            }
            row++;
        }
        Reader.Close();
    }

    
    //当日合计
    Cmd.CommandText =
        @"SELECT
sum(计划支数) as 计划支数
,sum(计划重量) as 计划重量
,sum(投入支数) as 投入支数
,sum(投入重量) as 投入重量
,sum(机紧1) as 机紧1
,sum(机紧2) as 机紧2
,sum(静水压) as 静水压
,sum(称测支数) as 称测支数
,sum(称测长度) as 称测长度
,sum(称测重量) as 称测重量
,sum(包装支数) as 包装支数
,sum(包装捆数) as 包装捆数
,sum(包装长度) as 包装长度
,sum(包装重量) as 包装重量
,sum(入库支数) as 入库支数
,sum(入库捆数) as 入库捆数
,sum(入库长度) as 入库长度
,sum(入库重量) as 入库重量
,sum(未入库支数) as 未入库支数
,sum(未入库重量) as 未入库重量
,sum(车丝1) as 车丝1
,sum(车丝2) as 车丝2
,sum(车丝3) as 车丝3
,sum(车丝4) as 车丝4
,sum(车丝5) as 车丝5
,sum(车丝6) as 车丝6
,count(*) as 班数
FROM 生产进度 where 分厂ID=" + fc + " and  日期 = '" + d1.ToShortDateString()+"'";

    Reader = Cmd.ExecuteReader();

    if (Reader.Read())
    {
        for (i = 0; i < 26; i++)
        {
            if (!Convert.IsDBNull(Reader[i]))
            {
                Data[360 + i] = Convert.ToDecimal(Reader[i]);
            }
        }
        DangRiBanCi = (int)Reader[26];
    }
    Reader.Close();

    //当月合计
    Cmd.CommandText =
        @"SELECT
sum(计划支数) as 计划支数
,sum(计划重量) as 计划重量
,sum(投入支数) as 投入支数
,sum(投入重量) as 投入重量
,sum(机紧1) as 机紧1
,sum(机紧2) as 机紧2
,sum(静水压) as 静水压
,sum(称测支数) as 称测支数
,sum(称测长度) as 称测长度
,sum(称测重量) as 称测重量
,sum(包装支数) as 包装支数
,sum(包装捆数) as 包装捆数
,sum(包装长度) as 包装长度
,sum(包装重量) as 包装重量
,sum(入库支数) as 入库支数
,sum(入库捆数) as 入库捆数
,sum(入库长度) as 入库长度
,sum(入库重量) as 入库重量
,sum(未入库支数) as 未入库支数
,sum(未入库重量) as 未入库重量
,sum(车丝1) as 车丝1
,sum(车丝2) as 车丝2
,sum(车丝3) as 车丝3
,sum(车丝4) as 车丝4
,sum(车丝5) as 车丝5
,sum(车丝6) as 车丝6
,count(*) as 班数
FROM 生产进度 where 分厂ID=" + fc + " and  日期 between '" + d2.ToShortDateString() + "' and '" + d1.ToShortDateString() + "'";

    Reader = Cmd.ExecuteReader();

    if (Reader.Read())
    {
        for (i = 0; i < 26; i++)
        {
            if (!Convert.IsDBNull(Reader[i]))
            {
                Data[390 + i] = Convert.ToDecimal(Reader[i]);
            }
        }
        LeiJiBanCi = (int)Reader[26];
    }
    Reader.Close();

    //年累计
    Cmd.CommandText =
        @"SELECT
sum(计划支数) as 计划支数
,sum(计划重量) as 计划重量
,sum(投入支数) as 投入支数
,sum(投入重量) as 投入重量
,sum(机紧1) as 机紧1
,sum(机紧2) as 机紧2
,sum(静水压) as 静水压
,sum(称测支数) as 称测支数
,sum(称测长度) as 称测长度
,sum(称测重量) as 称测重量
,sum(包装支数) as 包装支数
,sum(包装捆数) as 包装捆数
,sum(包装长度) as 包装长度
,sum(包装重量) as 包装重量
,sum(入库支数) as 入库支数
,sum(入库捆数) as 入库捆数
,sum(入库长度) as 入库长度
,sum(入库重量) as 入库重量
,sum(未入库支数) as 未入库支数
,sum(未入库重量) as 未入库重量
,sum(车丝1) as 车丝1
,sum(车丝2) as 车丝2
,sum(车丝3) as 车丝3
,sum(车丝4) as 车丝4
,sum(车丝5) as 车丝5
,sum(车丝6) as 车丝6
FROM 生产进度 where 分厂ID=" + fc + " and  日期 between '" + d3.ToShortDateString() + "' and '" + d1.ToShortDateString() + "'";

    Reader = Cmd.ExecuteReader();

    if (Reader.Read())
    {
        for (i = 0; i < 26; i++)
        {
            if (!Convert.IsDBNull(Reader[i]))
            {
                Data[420 + i] = Convert.ToDecimal(Reader[i]);
            }
        }
    }
    Reader.Close();
    
    
    Reader.Dispose();
    Cmd.Dispose();
    Conn.Close();
    Conn.Dispose();
}

    

    
</script>
<html>
<head>
<title></title>
</head>
<body>
<script type="text/javascript" language="javascript" src="/common.js"></script>
<form id="form1" runat="server">
<div id="wintop" class="wintop"><%=this.FenChang.SelectedItem.Text %> <%=this.ChanPin %>管体月生产报表
<font style="font-size:14px;font-weight:normal;"><span style="margin-left:50px;"></span>年累计：<asp:Label ID="Date3" runat="server" Text="" Width="100px"></asp:Label><span style="margin-left:10px;"></span>月累计：<asp:Label ID="Date2" runat="server" Text="" Width="100px"></asp:Label></font>
</div>
<asp:Panel ID="Panel1" runat="server" CssClass="panel">
生产单位：<asp:DropDownList ID="FenChang" runat="server" Width="103px" AutoPostBack="true">
    <asp:ListItem Value="2">二分厂</asp:ListItem>
    <asp:ListItem Value="5">五分厂</asp:ListItem>
</asp:DropDownList>
<span style="margin-left:10px;"></span>日期：<asp:TextBox ID="Date1" runat="server" CssClass="textbox" Width="110px"  AutoPostBack="true"></asp:TextBox><img alt="" src="/Icons/29.png" align="middle" onclick="makecalendar(document.getElementById('Date1').value, document.getElementById('Date1'));" />
<span style="margin-left:10px;"></span><input type="button" value="导出Excel" class="button" onclick="Export();"/>
</asp:Panel>

<asp:Panel ID="Panel2" runat="server" CssClass="panel3">
<style type="text/css">
td.bb{border:0.5pt solid black;text-align:center;padding:0.5pt;font-size:10pt;height:22px;font-family:宋体;mso-text-control:shrinktofit;white-space:nowrap;}
td.bb2{border:0.5pt solid black;text-align:center;padding:0.5pt;font-size:10pt;height:22px;font-family:宋体;}
td.nb{border:none;text-align:center;padding:0.5pt;font-size:10pt;height:22px;font-family:宋体;}
</style>
<table border=0 cellpadding=0 style=border-collapse:collapse;>
<tr>
<td colspan=17 class=nb style=font-size:18pt;font-weight:bold;height:22pt;><%=this.ChanPin %>管体月生产报表</td>
</tr>
<tr>
<td class=nb colspan=3>生产：<%=this.FenChang.SelectedItem.Text %></td>
<td class=nb colspan=3>日期：<%=this.Date1.Text %></td>
<td class=nb colspan=3>品种：<%=this.ChanPin %>管体</td>
<td class=nb colspan=2>钢级：<%=this.GangJi %></td>
<td class=nb colspan=4>规格(mm)：<%=this.GuiGe %></td>
<td class=nb colspan=2>编号：SYC/ZJ-GT-13</td>
</tr>
<tr>
<td class=bb2 colspan=2 rowspan=2 style='text-align:left;mso-diagonal-down:.5pt solid windowtext;'>　　　　　产量<br>　类别</td>
<td class=bb colspan=2><%=BanZhu[0] %></td>
<td class=bb colspan=2><%=BanZhu[1] %></td>
<td class=bb colspan=2><%=BanZhu[2] %></td>
<td class=bb colspan=2><%=BanZhu[3] %></td>
<td class=bb colspan=2><%=BanZhu[4] %></td>
<td class=bb colspan=2><%=BanZhu[5] %></td>
<td class=bb colspan=2>合计</td>
<td class=bb rowspan=2>年累计</td>
</tr>
<tr>
<td class=bb>当日</td>
<td class=bb>本月累计</td>
<td class=bb>当日</td>
<td class=bb>本月累计</td>
<td class=bb>当日</td>
<td class=bb>本月累计</td>
<td class=bb>当日</td>
<td class=bb>本月累计</td>
<td class=bb>当日</td>
<td class=bb>本月累计</td>
<td class=bb>当日</td>
<td class=bb>本月累计</td>
<td class=bb>当日</td>
<td class=bb>本月累计</td>
</tr>
<tr>
<td class=bb2 rowspan=2 width=50>原料<br>计划</td>
<td class=bb width=65>根数</td>
<td class=bb width=55><%=Data[0] %></td>
<td class=bb width=65><%=Data[180] %></td>
<td class=bb width=55><%=Data[30] %></td>
<td class=bb width=65><%=Data[210] %></td>
<td class=bb width=55><%=Data[60] %></td>
<td class=bb width=65><%=Data[240] %></td>
<td class=bb width=55><%=Data[90] %></td>
<td class=bb width=65><%=Data[270] %></td>
<td class=bb width=55><%=Data[120] %></td>
<td class=bb width=65><%=Data[300] %></td>
<td class=bb width=55><%=Data[150] %></td>
<td class=bb width=65><%=Data[330] %></td>
<td class=bb width=65><%=Data[360] %></td>
<td class=bb width=70><%=Data[390] %></td>
<td class=bb width=80><%=Data[420] %></td>
</tr>
<tr>
<td class=bb>重量(kg)</td>
<td class=bb><%=Data[1] %></td>
<td class=bb><%=Data[181] %></td>
<td class=bb><%=Data[31] %></td>
<td class=bb><%=Data[211] %></td>
<td class=bb><%=Data[61] %></td>
<td class=bb><%=Data[241] %></td>
<td class=bb><%=Data[91] %></td>
<td class=bb><%=Data[271] %></td>
<td class=bb><%=Data[121] %></td>
<td class=bb><%=Data[301] %></td>
<td class=bb><%=Data[151] %></td>
<td class=bb><%=Data[331] %></td>
<td class=bb><%=Data[361] %></td>
<td class=bb><%=Data[391] %></td>
<td class=bb><%=Data[421] %></td>
</tr>
<tr>
<td class=bb2 rowspan=2>原料<br>投入</td>
<td class=bb>根数</td>
<td class=bb><%=Data[2] %></td>
<td class=bb><%=Data[182] %></td>
<td class=bb><%=Data[32] %></td>
<td class=bb><%=Data[212] %></td>
<td class=bb><%=Data[62] %></td>
<td class=bb><%=Data[242] %></td>
<td class=bb><%=Data[92] %></td>
<td class=bb><%=Data[272] %></td>
<td class=bb><%=Data[122] %></td>
<td class=bb><%=Data[302] %></td>
<td class=bb><%=Data[152] %></td>
<td class=bb><%=Data[332] %></td>
<td class=bb><%=Data[362] %></td>
<td class=bb><%=Data[392] %></td>
<td class=bb><%=Data[422] %></td>
</tr>
<tr>
<td class=bb>重量(kg)</td>
<td class=bb><%=Data[3] %></td>
<td class=bb><%=Data[183] %></td>
<td class=bb><%=Data[33] %></td>
<td class=bb><%=Data[213] %></td>
<td class=bb><%=Data[63] %></td>
<td class=bb><%=Data[243] %></td>
<td class=bb><%=Data[93] %></td>
<td class=bb><%=Data[273] %></td>
<td class=bb><%=Data[123] %></td>
<td class=bb><%=Data[303] %></td>
<td class=bb><%=Data[153] %></td>
<td class=bb><%=Data[333] %></td>
<td class=bb><%=Data[363] %></td>
<td class=bb><%=Data[393] %></td>
<td class=bb><%=Data[423] %></td>
</tr>

<tr>
<td class=bb rowspan=7>车丝</td>
<td class=bb>1#</td>
<td class=bb><%=Data[20] %></td>
<td class=bb><%=Data[200] %></td>
<td class=bb><%=Data[50] %></td>
<td class=bb><%=Data[230] %></td>
<td class=bb><%=Data[80] %></td>
<td class=bb><%=Data[260] %></td>
<td class=bb><%=Data[110] %></td>
<td class=bb><%=Data[290] %></td>
<td class=bb><%=Data[140] %></td>
<td class=bb><%=Data[320] %></td>
<td class=bb><%=Data[170] %></td>
<td class=bb><%=Data[350] %></td>
<td class=bb><%=Data[380] %></td>
<td class=bb><%=Data[410] %></td>
<td class=bb><%=Data[440] %></td>
</tr>

<tr>
<td class=bb>2#</td>
<td class=bb><%=Data[21] %></td>
<td class=bb><%=Data[201] %></td>
<td class=bb><%=Data[51] %></td>
<td class=bb><%=Data[231] %></td>
<td class=bb><%=Data[81] %></td>
<td class=bb><%=Data[261] %></td>
<td class=bb><%=Data[111] %></td>
<td class=bb><%=Data[291] %></td>
<td class=bb><%=Data[141] %></td>
<td class=bb><%=Data[321] %></td>
<td class=bb><%=Data[171] %></td>
<td class=bb><%=Data[351] %></td>
<td class=bb><%=Data[381] %></td>
<td class=bb><%=Data[411] %></td>
<td class=bb><%=Data[441] %></td>
</tr>
<tr>
<td class=bb>3#</td>
<td class=bb><%=Data[22] %></td>
<td class=bb><%=Data[202] %></td>
<td class=bb><%=Data[52] %></td>
<td class=bb><%=Data[232] %></td>
<td class=bb><%=Data[82] %></td>
<td class=bb><%=Data[262] %></td>
<td class=bb><%=Data[112] %></td>
<td class=bb><%=Data[292] %></td>
<td class=bb><%=Data[142] %></td>
<td class=bb><%=Data[322] %></td>
<td class=bb><%=Data[172] %></td>
<td class=bb><%=Data[352] %></td>
<td class=bb><%=Data[382] %></td>
<td class=bb><%=Data[412] %></td>
<td class=bb><%=Data[442] %></td>
</tr>
<tr>
<td class=bb>4#</td>
<td class=bb><%=Data[23] %></td>
<td class=bb><%=Data[203] %></td>
<td class=bb><%=Data[53] %></td>
<td class=bb><%=Data[233] %></td>
<td class=bb><%=Data[83] %></td>
<td class=bb><%=Data[263] %></td>
<td class=bb><%=Data[113] %></td>
<td class=bb><%=Data[293] %></td>
<td class=bb><%=Data[143] %></td>
<td class=bb><%=Data[323] %></td>
<td class=bb><%=Data[173] %></td>
<td class=bb><%=Data[353] %></td>
<td class=bb><%=Data[383] %></td>
<td class=bb><%=Data[413] %></td>
<td class=bb><%=Data[443] %></td>
</tr>
<tr>
<td class=bb>5#</td>
<td class=bb><%=Data[24] %></td>
<td class=bb><%=Data[204] %></td>
<td class=bb><%=Data[54] %></td>
<td class=bb><%=Data[234] %></td>
<td class=bb><%=Data[84] %></td>
<td class=bb><%=Data[264] %></td>
<td class=bb><%=Data[114] %></td>
<td class=bb><%=Data[294] %></td>
<td class=bb><%=Data[144] %></td>
<td class=bb><%=Data[324] %></td>
<td class=bb><%=Data[174] %></td>
<td class=bb><%=Data[354] %></td>
<td class=bb><%=Data[384] %></td>
<td class=bb><%=Data[414] %></td>
<td class=bb><%=Data[444] %></td>
</tr>
<tr>
<td class=bb>6#</td>
<td class=bb><%=Data[25] %></td>
<td class=bb><%=Data[205] %></td>
<td class=bb><%=Data[55] %></td>
<td class=bb><%=Data[235] %></td>
<td class=bb><%=Data[85] %></td>
<td class=bb><%=Data[265] %></td>
<td class=bb><%=Data[115] %></td>
<td class=bb><%=Data[295] %></td>
<td class=bb><%=Data[145] %></td>
<td class=bb><%=Data[325] %></td>
<td class=bb><%=Data[175] %></td>
<td class=bb><%=Data[355] %></td>
<td class=bb><%=Data[385] %></td>
<td class=bb><%=Data[415] %></td>
<td class=bb><%=Data[445] %></td>
</tr>
<tr>
<td class=bb>小计</td>
<td class=bb><%=Data[20] + Data[21] + Data[22] + Data[23] + Data[24] + Data[25]%></td>
<td class=bb><%=Data[200] + Data[201] + Data[202] + Data[203] + Data[204] + Data[205]%></td>
<td class=bb><%=Data[50] + Data[51] + Data[52] + Data[53] + Data[54] + Data[55]%></td>
<td class=bb><%=Data[230] + Data[231] + Data[232] + Data[233] + Data[234] + Data[235]%></td>
<td class=bb><%=Data[80] + Data[81] + Data[82] + Data[83] + Data[84] + Data[85]%></td>
<td class=bb><%=Data[260] + Data[261] + Data[262] + Data[263] + Data[264] + Data[265]%></td>
<td class=bb><%=Data[110] + Data[111] + Data[112] + Data[113] + Data[114] + Data[115]%></td>
<td class=bb><%=Data[290] + Data[291] + Data[292] + Data[293] + Data[294] + Data[295]%></td>
<td class=bb><%=Data[140] + Data[141] + Data[142] + Data[143] + Data[144] + Data[145]%></td>
<td class=bb><%=Data[320] + Data[321] + Data[322] + Data[323] + Data[324] + Data[325]%></td>
<td class=bb><%=Data[170] + Data[171] + Data[172] + Data[173] + Data[174] + Data[175]%></td>
<td class=bb><%=Data[350] + Data[351] + Data[352] + Data[353] + Data[354] + Data[355]%></td>
<td class=bb><%=Data[380] + Data[381] + Data[381] + Data[381] + Data[381] + Data[381]%></td>
<td class=bb><%=Data[410] + Data[411] + Data[412] + Data[413] + Data[414] + Data[415]%></td>
<td class=bb><%=Data[440] + Data[441] + Data[442] + Data[443] + Data[444] + Data[445]%></td>
</tr>

<tr>
<td class=bb rowspan=2>机紧</td>
<td class=bb>(自)合格</td>
<td class=bb><%=Data[4] %></td>
<td class=bb><%=Data[184] %></td>
<td class=bb><%=Data[34] %></td>
<td class=bb><%=Data[214] %></td>
<td class=bb><%=Data[64] %></td>
<td class=bb><%=Data[244] %></td>
<td class=bb><%=Data[94] %></td>
<td class=bb><%=Data[274] %></td>
<td class=bb><%=Data[124] %></td>
<td class=bb><%=Data[304] %></td>
<td class=bb><%=Data[154] %></td>
<td class=bb><%=Data[334] %></td>
<td class=bb><%=Data[364] %></td>
<td class=bb><%=Data[394] %></td>
<td class=bb><%=Data[424] %></td>
</tr>
<tr>
<td class=bb>外购接箍</td>
<td class=bb><%=Data[5] %></td>
<td class=bb><%=Data[185] %></td>
<td class=bb><%=Data[35] %></td>
<td class=bb><%=Data[215] %></td>
<td class=bb><%=Data[65] %></td>
<td class=bb><%=Data[245] %></td>
<td class=bb><%=Data[95] %></td>
<td class=bb><%=Data[275] %></td>
<td class=bb><%=Data[125] %></td>
<td class=bb><%=Data[305] %></td>
<td class=bb><%=Data[155] %></td>
<td class=bb><%=Data[335] %></td>
<td class=bb><%=Data[365] %></td>
<td class=bb><%=Data[395] %></td>
<td class=bb><%=Data[425] %></td>
</tr>
<tr>
<td class=bb>静水压</td>
<td class=bb>合格</td>
<td class=bb><%=Data[6] %></td>
<td class=bb><%=Data[186] %></td>
<td class=bb><%=Data[36] %></td>
<td class=bb><%=Data[216] %></td>
<td class=bb><%=Data[66] %></td>
<td class=bb><%=Data[246] %></td>
<td class=bb><%=Data[96] %></td>
<td class=bb><%=Data[276] %></td>
<td class=bb><%=Data[126] %></td>
<td class=bb><%=Data[306] %></td>
<td class=bb><%=Data[156] %></td>
<td class=bb><%=Data[336] %></td>
<td class=bb><%=Data[366] %></td>
<td class=bb><%=Data[396] %></td>
<td class=bb><%=Data[426] %></td>
</tr>
<tr>
<td class=bb2 rowspan=3>称重<br>测长</td>
<td class=bb>根数</td>
<td class=bb><%=Data[7] %></td>
<td class=bb><%=Data[187] %></td>
<td class=bb><%=Data[37] %></td>
<td class=bb><%=Data[217] %></td>
<td class=bb><%=Data[67] %></td>
<td class=bb><%=Data[247] %></td>
<td class=bb><%=Data[97] %></td>
<td class=bb><%=Data[277] %></td>
<td class=bb><%=Data[127] %></td>
<td class=bb><%=Data[307] %></td>
<td class=bb><%=Data[157] %></td>
<td class=bb><%=Data[337] %></td>
<td class=bb><%=Data[367] %></td>
<td class=bb><%=Data[397] %></td>
<td class=bb><%=Data[427] %></td>
</tr>
<tr>
<td class=bb>长度(m)</td>
<td class=bb><%=Data[8] %></td>
<td class=bb><%=Data[188] %></td>
<td class=bb><%=Data[38] %></td>
<td class=bb><%=Data[218] %></td>
<td class=bb><%=Data[68] %></td>
<td class=bb><%=Data[248] %></td>
<td class=bb><%=Data[98] %></td>
<td class=bb><%=Data[278] %></td>
<td class=bb><%=Data[128] %></td>
<td class=bb><%=Data[308] %></td>
<td class=bb><%=Data[158] %></td>
<td class=bb><%=Data[338] %></td>
<td class=bb><%=Data[368] %></td>
<td class=bb><%=Data[398] %></td>
<td class=bb><%=Data[429] %></td>
</tr>
<tr>
<td class=bb>重量(kg)</td>
<td class=bb><%=Data[9] %></td>
<td class=bb><%=Data[189] %></td>
<td class=bb><%=Data[39] %></td>
<td class=bb><%=Data[219] %></td>
<td class=bb><%=Data[69] %></td>
<td class=bb><%=Data[249] %></td>
<td class=bb><%=Data[99] %></td>
<td class=bb><%=Data[279] %></td>
<td class=bb><%=Data[129] %></td>
<td class=bb><%=Data[309] %></td>
<td class=bb><%=Data[159] %></td>
<td class=bb><%=Data[339] %></td>
<td class=bb><%=Data[369] %></td>
<td class=bb><%=Data[399] %></td>
<td class=bb><%=Data[429] %></td>
</tr>
<tr>
<td class=bb2 rowspan=4>成品<br>包装</td>
<td class=bb>根数</td>
<td class=bb><%=Data[10] %></td>
<td class=bb><%=Data[190] %></td>
<td class=bb><%=Data[40] %></td>
<td class=bb><%=Data[220] %></td>
<td class=bb><%=Data[70] %></td>
<td class=bb><%=Data[250] %></td>
<td class=bb><%=Data[100] %></td>
<td class=bb><%=Data[280] %></td>
<td class=bb><%=Data[130] %></td>
<td class=bb><%=Data[310] %></td>
<td class=bb><%=Data[160] %></td>
<td class=bb><%=Data[340] %></td>
<td class=bb><%=Data[370] %></td>
<td class=bb><%=Data[400] %></td>
<td class=bb><%=Data[430] %></td>
</tr>
<tr>
<td class=bb>捆数</td>
<td class=bb><%=Data[11] %></td>
<td class=bb><%=Data[191] %></td>
<td class=bb><%=Data[41] %></td>
<td class=bb><%=Data[221] %></td>
<td class=bb><%=Data[71] %></td>
<td class=bb><%=Data[251] %></td>
<td class=bb><%=Data[101] %></td>
<td class=bb><%=Data[281] %></td>
<td class=bb><%=Data[131] %></td>
<td class=bb><%=Data[311] %></td>
<td class=bb><%=Data[161] %></td>
<td class=bb><%=Data[341] %></td>
<td class=bb><%=Data[371] %></td>
<td class=bb><%=Data[401] %></td>
<td class=bb><%=Data[431] %></td>
</tr>
<tr>
<td class=bb>长度(m)</td>
<td class=bb><%=Data[12] %></td>
<td class=bb><%=Data[192] %></td>
<td class=bb><%=Data[42] %></td>
<td class=bb><%=Data[222] %></td>
<td class=bb><%=Data[72] %></td>
<td class=bb><%=Data[252] %></td>
<td class=bb><%=Data[102] %></td>
<td class=bb><%=Data[282] %></td>
<td class=bb><%=Data[132] %></td>
<td class=bb><%=Data[312] %></td>
<td class=bb><%=Data[162] %></td>
<td class=bb><%=Data[342] %></td>
<td class=bb><%=Data[372] %></td>
<td class=bb><%=Data[402] %></td>
<td class=bb><%=Data[432] %></td>
</tr>
<tr>
<td class=bb>重量(kg)</td>
<td class=bb><%=Data[13] %></td>
<td class=bb><%=Data[193] %></td>
<td class=bb><%=Data[43] %></td>
<td class=bb><%=Data[223] %></td>
<td class=bb><%=Data[73] %></td>
<td class=bb><%=Data[253] %></td>
<td class=bb><%=Data[103] %></td>
<td class=bb><%=Data[283] %></td>
<td class=bb><%=Data[133] %></td>
<td class=bb><%=Data[313] %></td>
<td class=bb><%=Data[163] %></td>
<td class=bb><%=Data[343] %></td>
<td class=bb><%=Data[373] %></td>
<td class=bb><%=Data[403] %></td>
<td class=bb><%=Data[433] %></td>
</tr>
<tr>
<td class=bb rowspan=4>入库量</td>
<td class=bb>根数</td>
<td class=bb><%=Data[14] %></td>
<td class=bb><%=Data[194] %></td>
<td class=bb><%=Data[44] %></td>
<td class=bb><%=Data[224] %></td>
<td class=bb><%=Data[74] %></td>
<td class=bb><%=Data[254] %></td>
<td class=bb><%=Data[104] %></td>
<td class=bb><%=Data[284] %></td>
<td class=bb><%=Data[134] %></td>
<td class=bb><%=Data[314] %></td>
<td class=bb><%=Data[164] %></td>
<td class=bb><%=Data[344] %></td>
<td class=bb><%=Data[374] %></td>
<td class=bb><%=Data[404] %></td>
<td class=bb><%=Data[434] %></td>
</tr>
<tr>
<td class=bb>捆数</td>
<td class=bb><%=Data[15] %></td>
<td class=bb><%=Data[195] %></td>
<td class=bb><%=Data[45] %></td>
<td class=bb><%=Data[225] %></td>
<td class=bb><%=Data[75] %></td>
<td class=bb><%=Data[255] %></td>
<td class=bb><%=Data[105] %></td>
<td class=bb><%=Data[285] %></td>
<td class=bb><%=Data[135] %></td>
<td class=bb><%=Data[315] %></td>
<td class=bb><%=Data[165] %></td>
<td class=bb><%=Data[345] %></td>
<td class=bb><%=Data[375] %></td>
<td class=bb><%=Data[405] %></td>
<td class=bb><%=Data[435] %></td>
</tr>
<tr>
<td class=bb>长度(m)</td>
<td class=bb><%=Data[16] %></td>
<td class=bb><%=Data[196] %></td>
<td class=bb><%=Data[46] %></td>
<td class=bb><%=Data[226] %></td>
<td class=bb><%=Data[76] %></td>
<td class=bb><%=Data[256] %></td>
<td class=bb><%=Data[106] %></td>
<td class=bb><%=Data[286] %></td>
<td class=bb><%=Data[136] %></td>
<td class=bb><%=Data[316] %></td>
<td class=bb><%=Data[166] %></td>
<td class=bb><%=Data[346] %></td>
<td class=bb><%=Data[376] %></td>
<td class=bb><%=Data[406] %></td>
<td class=bb><%=Data[436] %></td>
</tr>
<tr>
<td class=bb>重量(kg)</td>
<td class=bb><%=Data[17] %></td>
<td class=bb><%=Data[197] %></td>
<td class=bb><%=Data[47] %></td>
<td class=bb><%=Data[227] %></td>
<td class=bb><%=Data[77] %></td>
<td class=bb><%=Data[257] %></td>
<td class=bb><%=Data[107] %></td>
<td class=bb><%=Data[287] %></td>
<td class=bb><%=Data[137] %></td>
<td class=bb><%=Data[317] %></td>
<td class=bb><%=Data[167] %></td>
<td class=bb><%=Data[347] %></td>
<td class=bb><%=Data[377] %></td>
<td class=bb><%=Data[407] %></td>
<td class=bb><%=Data[437] %></td>
</tr>
<tr>
<td class=bb2 rowspan=2>未入<br>库量</td>
<td class=bb>根数</td>
<td class=bb><%=Data[18] %></td>
<td class=bb><%=Data[198] %></td>
<td class=bb><%=Data[48] %></td>
<td class=bb><%=Data[228] %></td>
<td class=bb><%=Data[78] %></td>
<td class=bb><%=Data[258] %></td>
<td class=bb><%=Data[108] %></td>
<td class=bb><%=Data[288] %></td>
<td class=bb><%=Data[138] %></td>
<td class=bb><%=Data[318] %></td>
<td class=bb><%=Data[168] %></td>
<td class=bb><%=Data[348] %></td>
<td class=bb><%=Data[378] %></td>
<td class=bb><%=Data[408] %></td>
<td class=bb><%=Data[438] %></td>
</tr>
<tr>
<td class=bb>重量(kg)</td>
<td class=bb><%=Data[19] %></td>
<td class=bb><%=Data[199] %></td>
<td class=bb><%=Data[49] %></td>
<td class=bb><%=Data[229] %></td>
<td class=bb><%=Data[79] %></td>
<td class=bb><%=Data[259] %></td>
<td class=bb><%=Data[109] %></td>
<td class=bb><%=Data[289] %></td>
<td class=bb><%=Data[139] %></td>
<td class=bb><%=Data[319] %></td>
<td class=bb><%=Data[169] %></td>
<td class=bb><%=Data[349] %></td>
<td class=bb><%=Data[379] %></td>
<td class=bb><%=Data[409] %></td>
<td class=bb><%=Data[439] %></td>
</tr>
<tr>
<td class=nb colspan=2 style=text-align:right;>当日班次：</td>
<td class=nb colspan=2 style=text-align:left;><%=DangRiBanCi %>个</td>
<td class=nb colspan=2 style=text-align:right;>累计班次：</td>
<td class=nb colspan=3 style=text-align:left;><%=LeiJiBanCi %>个</td>
<td class=nb style=text-align:right;>批准：</td>
<td class=nb colspan=3></td>
<td class=nb colspan=2 style=text-align:right;>制表人：</td>
<td class=nb colspan=2 style=text-align:left;>
<%
    string op = (string)this.Session["OperatorName"];
    if (op == null)
    {
        op = "";
    }
    Response.Write("<span style=display:none>"+op+"</span>");
%>
</td>
</tr>
</table>
</asp:Panel>
</form>
<form id="form2" method="post" action="/PageExport.ashx">
<input type="hidden" name="filename" value="月生产报表.xls" />
<input type="hidden" name="content" value="" />
</form>
<script type="text/javascript">
    var notice = '';
    if (notice != '') {
        parent.showmsgbox(notice);
    }
</script>
<script type="text/javascript">
    var textboxs = document.getElementsByTagName("input");
    var i;
    for (i = 0; i < textboxs.length; i++) {
        if (textboxs[i].className == "textbox") {
            //textboxs[i].onchange = function(e) { this.className = "textbox-changed"; };
            textboxs[i].onfocus = function(e) { this.select(); };
        }
        else if (textboxs[i].className == "pageturn" || textboxs[i].className == "intxt1" || textboxs[i].className == "textbox") {
            textboxs[i].onfocus = function(e) { this.select(); };
        }
    }
    //导出Excel
    function Export() {
        var code = document.getElementById("Panel2").innerHTML;
        form2.content.value =
"<html xmlns:o='urn:schemas-microsoft-com:office:office'\nxmlns:x='urn:schemas-microsoft-com:office:excel'\nxmlns='http://www.w3.org/TR/REC-html40'>\n<head>\n<meta http-equiv=Content-Type content='text/html; charset=utf-8'>\n<style>\n<!--table\n@page\n{margin:.12in .12in .12in .12in;\n mso-header-margin:.12in;\n mso-footer-margin:.12in;\n mso-page-orientation:landscape;\n mso-horizontal-page-align:center;\n mso-vertical-page-align:center;}\nbr{mso-data-placement:same-cell;}\n-->\n</style>\n<!--[if gte mso 9]><xml>\n<x:ExcelWorkbook>\n<x:ExcelWorksheets>\n<x:ExcelWorksheet>\n<x:Name>月生产报表</x:Name>\n<x:WorksheetOptions>\n<x:DefaultRowHeight>285</x:DefaultRowHeight>\n<x:Print>\n<x:ValidPrinterInfo/>\n<x:Scale>100</x:Scale>\n<x:PaperSizeIndex>9</x:PaperSizeIndex>\n<x:HorizontalResolution>200</x:HorizontalResolution>\n<x:VerticalResolution>200</x:VerticalResolution>\n</x:Print>\n<x:Selected/>\n<x:Panes>\n<x:Pane>\n<x:Number>3</x:Number>\n<x:ActiveRow>0</x:ActiveRow>\n<x:ActiveCol>0</x:ActiveCol>\n</x:Pane>\n</x:Panes>\n</x:WorksheetOptions>\n</x:ExcelWorksheet>\n</x:ExcelWorkbook>\n</xml><![endif]-->\n</head>\n<body>"
        + code + "</body></html>";
        form2.submit();
    }
</script>
</body>
</html>
